<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title><?php echo ($current['title']); ?>-<?php echo (C("sitename")); ?></title>

    <meta name="keywords" content="<?php echo (C("keywords")); ?>"/>
    <meta name="description" content="<?php echo (C("description")); ?>"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>


    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="/Public/qwadmin/css/bootstrap.css"/>
    <link rel="stylesheet" href="/Public/qwadmin/css/font-awesome.css"/>
    <link rel="stylesheet" href="/Public/qwadmin/css/jquery-ui.css"/>
    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="/Public/qwadmin/css/ace-fonts.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="/Public/qwadmin/css/ace.css" class="ace-main-stylesheet" id="main-ace-style"/>
	<link rel="stylesheet" href="/Public/qwadmin/css/bootstrap-colorpicker.css" >
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/Public/qwadmin/css/ace-part2.css" class="ace-main-stylesheet"/>
    <![endif]-->

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/Public/qwadmin/css/ace-ie.css"/>

    <![endif]-->

    <!-- inline styles related to this page -->
	<link rel="stylesheet" href="/Public/qwadmin/css/viewer.min.css">
    <!-- ace settings handler -->
    <script src="/Public/qwadmin/js/ace-extra.js"></script>

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="/Public/qwadmin/js/html5shiv.js"></script>
    <script src="/Public/qwadmin/js/respond.js"></script>
    <![endif]-->
    
    <!-- webuploader -->
    <script type="text/javascript" src="/Public/qwadmin/js/jquery-2.0.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/Public/qwadmin/js/webuploader/webuploader.css">
    <script type="text/javascript" src="/Public/qwadmin/js/webuploader/webuploader.js"></script>
    <script type="text/javascript" src="/Public/qwadmin/js/bootstrap-select.js"></script>
    <!-- layer js --> 
    <script type="text/javascript" src="/Public/qwadmin/layer/layer.js"></script>
        <link rel="stylesheet" href="/Public/qwadmin/css/sort.css"/>
</head>
<body class="no-skin">
    <!-- #section:basics/navbar.layout -->
    <div id="navbar" class="navbar navbar-default">
        <script type="text/javascript">
            try {
                ace.settings.check('navbar', 'fixed')
            } catch (e) {
            }
        </script>

        <div class="navbar-container" id="navbar-container">
            <!-- #section:basics/sidebar.mobile.toggle -->
            <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
                <span class="sr-only">Toggle sidebar</span>

                <span class="icon-bar"></span>

                <span class="icon-bar"></span>

                <span class="icon-bar"></span>
            </button>

            <!-- /section:basics/sidebar.mobile.toggle -->
            <div class="navbar-header pull-left">
                <!-- #section:basics/navbar.layout.brand -->
                <a href="<?php echo U('index/index');?>" class="navbar-brand">
                    <small>
                        <i class="fa fa-home"></i>
                        <?php echo (C("sitename")); ?>
                    </small>
                </a>

                <!-- /section:basics/navbar.layout.brand -->

                <!-- #section:basics/navbar.toggle -->

                <!-- /section:basics/navbar.toggle -->
            </div>

            <!-- #section:basics/navbar.dropdown -->
            <div class="navbar-buttons navbar-header pull-right" role="navigation">
                <ul class="nav ace-nav">
                    <!-- #section:basics/navbar.user_menu -->
                    <li class="red">
                        <a href="<?php echo U('cache/clear');?>" title="清除缓存" target="_self">
                            <i class="ace-icon fa glyphicon-trash"></i>
                        </a>
                    </li>
                    <li class="red">
                        <a href="/" title="前台首页" target="_blank">
                            <i class="ace-icon fa fa-home"></i>
                        </a>
                    </li>
                    <li class="purple dropdown-modal">
						<a data-toggle="dropdown" class="dropdown-toggle" href="#" aria-expanded="false">
							<i class="ace-icon fa fa-bell"></i>
							<span class="badge badge-important"><b id="total_tip_1"><?php echo ($total_count); ?></b></span>
						</a>
					<ul class="dropdown-menu-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close">
						<li class="dropdown-header">
							<i class="ace-icon fa fa-exclamation-triangle"></i>
								<b id="total_tip_2"><?php echo ($total_count); ?></b> 条待处理消息提醒
						</li>
						<li class="dropdown-content ace-scroll" style="position: relative;">
							<div class="scroll-track" style="display: none;">
								<div class="scroll-bar"></div>
							</div>
							<div class="scroll-content" style="">
								<ul class="dropdown-menu dropdown-navbar navbar-pink">
									<li>
										<a href="<?php echo U('Task/index',array('pay_status'=>2));?>">
											<div class="clearfix">
												<span class="pull-left">
														新发布任务待审核
												</span>
												<span class="pull-right badge badge-info">+<b id="task_tip"><?php echo ($task_count); ?></b></span>
											</div>
										</a>
									</li>
									<li>
										<a href="<?php echo U('Usertask/index',array('status'=>1));?>">
										<div class="clearfix">
											<span class="pull-left">
											
												任务接单待审核
											</span>	
											<span class="pull-right badge badge-info">+<b id="user_task_tip"><?php echo ($user_task_count); ?></b></span>
										</div>	
										</a>
									</li>
									<li>
										<a href="<?php echo U('Order/index',array('status'=>1));?>">
										<div class="clearfix">
											<span class="pull-left">
											
												会员收益待审核
											</span>	
											<span class="pull-right badge badge-info">+<b id="user_level_tip"><?php echo ($user_level_count); ?></b></span>
										</div>	
										</a>
									</li>
									<li>
										<a href="<?php echo U('Tixian/index',array('status'=>1));?>">
										<div class="clearfix">
											<span class="pull-left">
												用户提现待审核
											</span>	
											<span class="pull-right badge badge-info">+<b id="tixian_tip"><?php echo ($tixian_count); ?></b></span>
										</div>	
										</a>
									</li>
								</ul>
							</div>
						</li>
						<li class="dropdown-footer">
							<a href="javasvript:;">
								
							</a>
						</li>
					</ul>
					</li>
                    <li class="light-blue">
                        <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                            <img class="nav-user-photo" src="<?php if( $user["head"] == ''): ?>/Public/qwadmin/avatars/avatar2.png
                            <?php else: echo ($user["head"]); endif; ?>" alt="<?php echo ($user["user"]); ?>" />
                            <span class="user-info">
                                <small>欢迎光临，</small>
                                <?php echo ($user["user"]); ?>
                            </span>

                            <i class="ace-icon fa fa-caret-down"></i>
                        </a>

                        <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                            <li>
                                <a href="<?php echo U('Setting/Setting');?>">
                                    <i class="ace-icon fa fa-cog"></i>
                                    设置
                                </a>
                            </li>

                            <li>
                                <a href="<?php echo U('Personal/profile');?>">
                                    <i class="ace-icon fa fa-user"></i>
                                    个人资料
                                </a>
                            </li>

                            <li class="divider"></li>

                            <li>
                                <a href="<?php echo U('logout/index');?>">
                                    <i class="ace-icon fa fa-power-off"></i>
                                    退出
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- /section:basics/navbar.user_menu -->
                </ul>
            </div>

            <!-- /section:basics/navbar.dropdown -->
        </div><!-- /.navbar-container -->
    </div>
	<script type="text/javascript">
	$(function(){
		window.setInterval("updateNotice()",3000);
	});	
	function updateNotice(){
		$.ajax({
            type : "post",
            url : "<?php echo U('Notice/update');?>",
            data: {},
            dataType : "json",
            async: true, 
            success: function(data) {
                r = eval(data);
                $("#total_tip_1").text(r.total_count);
                $("#total_tip_2").text(r.total_count);
                $("#task_tip").text(r.task_count);
                $("#user_task_tip").text(r.user_task_count);
                $("#user_level_tip").text(r.user_level_count);
                $("#tixian_tip").text(r.tixian_count);
            }
      	});  
	}
	</script>	
    <!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

        <!-- #section:basics/sidebar -->
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="nav nav-list">
            <?php if(is_array($menu)): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li
                <?php if(($v['id'] == $current['id']) OR ($v['id'] == $current['pid']) OR ($v['id'] == $current['ppid'])): ?>class="active
                    <?php if($current['pid'] != '0'): ?>open<?php endif; ?>
                    "<?php endif; ?>
                >
                <a href="<?php if(empty($v["name"])): ?>#
                <?php else: ?>
                <?php echo U($v['name']); endif; ?>"
                <?php if(!empty($v["children"])): ?>class="dropdown-toggle"<?php endif; ?>
                >
                <i class="<?php echo ($v["icon"]); ?>"></i>
                <span class="menu-text">
                                    <?php echo ($v["title"]); ?>
                                </span>
                <?php if(!empty($v["children"])): ?><b class="arrow fa fa-angle-down"></b><?php endif; ?>
                </a>

                <b class="arrow"></b>
                <?php if(!empty($v["children"])): ?><ul class="submenu">
                        <?php if(is_array($v["children"])): $i = 0; $__LIST__ = $v["children"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><li
                            <?php if(($vv['id'] == $current['id']) OR ($vv['id'] == $current['pid'])): ?>class="active
                                <?php if($current['ppid'] != '0'): ?>open<?php endif; ?>
                                "<?php endif; ?>
                            >
                            <a href="<?php if(empty($vv["children"])): echo U($vv['name']);?>
                            <?php else: ?>
                            #<?php endif; ?>"
                            <?php if(!empty($vv["children"])): ?>class="dropdown-toggle"<?php endif; ?>
                            >
                            <i class="<?php echo ($vv["icon"]); ?>"></i>
                            <?php echo ($vv["title"]); ?>
                            <?php if(!empty($vv["children"])): ?><b class="arrow fa fa-angle-down"></b><?php endif; ?>
                            </a>

                            <b class="arrow"></b>
                            <?php if(!empty($vv["children"])): ?><ul class="submenu">
                                    <?php if(is_array($vv["children"])): $i = 0; $__LIST__ = $vv["children"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vvv): $mod = ($i % 2 );++$i;?><li
                                        <?php if($vvv['id'] == $current['id']): ?>class="active"<?php endif; ?>
                                        >
                                        <a href="<?php echo U($vvv['name']);?>">
                                            <i class="<?php echo ($vvv["icon"]); ?>"></i>
                                            <?php echo ($vvv["title"]); ?>
                                        </a>
                                        <b class="arrow"></b>
                                        </li><?php endforeach; endif; else: echo "" ;endif; ?>
                                </ul><?php endif; ?>
                            </li><?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul><?php endif; ?>
                </li><?php endforeach; endif; else: echo "" ;endif; ?>

        </ul><!-- /.nav-list -->

        <!-- #section:basics/sidebar.layout.minimize -->
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
               data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <!-- /section:basics/sidebar.layout.minimize -->
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'collapsed')
            } catch (e) {
            }
        </script>
    </div>

    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
                <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="<?php echo U('index/index');?>">首页</a>
            </li>
            <?php if(isset($current['ptitle'])): ?><li>
                    <a href="#"><?php echo ($current['ptitle']); ?></a>
                </li><?php endif; ?>
            <li class="active"><?php echo ($current['title']); ?></li>
        </ul><!-- /.breadcrumb -->
    </div>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                    <!-- #section:settings.box -->
    <?php if($current["tips"] != ''): ?><div class="alert alert-block alert-success">
            <button type="button" class="close" data-dismiss="alert">
                <i class="ace-icon fa fa-times"></i>
            </button>
            <!--i class="ace-icon fa fa-check green"></i-->
            <?php echo ($current["tips"]); ?>
        </div><?php endif; ?>
    <div class="ace-settings-container" id="ace-settings-container">
        <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
            <i class="ace-icon fa fa-cog bigger-130"></i>
        </div>

        <div class="ace-settings-box clearfix" id="ace-settings-box">
            <div class="pull-left width-50">
                <!-- #section:settings.skins -->
                <div class="ace-settings-item">
                    <div class="pull-left">
                        <select id="skin-colorpicker" class="hide">
                            <option data-skin="no-skin" value="#438EB9">#438EB9</option>
                            <option data-skin="skin-1" value="#222A2D">#222A2D</option>
                            <option data-skin="skin-2" value="#C6487E">#C6487E</option>
                            <option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
                        </select>
                    </div>
                    <span>&nbsp; 选择皮肤</span>
                </div>

                <!-- /section:settings.skins -->

                <!-- #section:settings.navbar -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar"/>
                    <label class="lbl" for="ace-settings-navbar"> 固定导航条</label>
                </div>

                <!-- /section:settings.navbar -->

                <!-- #section:settings.sidebar -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar"/>
                    <label class="lbl" for="ace-settings-sidebar"> 固定侧边栏</label>
                </div>

                <!-- /section:settings.sidebar -->

                <!-- #section:settings.breadcrumbs -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs"/>
                    <label class="lbl" for="ace-settings-breadcrumbs"> 固定面包屑</label>
                </div>

                <!-- /section:settings.breadcrumbs -->

                <!-- #section:settings.rtl -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl"/>
                    <label class="lbl" for="ace-settings-rtl"> 切换至左边</label>
                </div>

                <!-- /section:settings.rtl -->

                <!-- #section:settings.container -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container"/>
                    <label class="lbl" for="ace-settings-add-container">
                        切换宽窄度
                    </label>
                </div>

                <!-- /section:settings.container -->
            </div><!-- /.pull-left -->

            <div class="pull-left width-50">
                <!-- #section:basics/sidebar.options -->
                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover"/>
                    <label class="lbl" for="ace-settings-hover"> 子菜单收起</label>
                </div>

                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact"/>
                    <label class="lbl" for="ace-settings-compact"> 侧边栏紧凑</label>
                </div>

                <div class="ace-settings-item">
                    <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight"/>
                    <label class="lbl" for="ace-settings-highlight"> 当前位置</label>
                </div>

                <!-- /section:basics/sidebar.options -->
            </div><!-- /.pull-left -->
        </div><!-- /.ace-settings-box -->
    </div><!-- /.ace-settings-container -->

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" id="form" method="post" action="<?php echo ($method); ?>">
                            <!-- PAGE CONTENT BEGINS -->
                            <input type="hidden" name="id" value="<?php echo ($vo["id"]); ?>"/>
                            <input type="hidden" name="p" value="<?php echo ($p); ?>"/>
                            <input type="hidden" name="uid" value="<?php echo ($vo["uid"]); ?>"/>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-0">
                                   平台分类 </label>
                                <div class="col-sm-9">
                                    <select id="cid" name="cid" class="col-xs-10 col-sm-5">
                                        <?php if(is_array($task_cate)): $i = 0; $__LIST__ = $task_cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tcate): $mod = ($i % 2 );++$i;?><option value="<?php echo ($tcate['id']); ?>" <?php if($tcate['id'] == $vo['cid']): ?>selected<?php endif; ?>>--<?php echo ($tcate["title"]); ?>--</option><?php endforeach; endif; else: echo "" ;endif; ?>
                                    </select>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">选择所属平台分类。</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            
                            <?php if($vo['id'] != ''): ?><div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    标题 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="title" id="title" placeholder="任务标题"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['title']); ?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">任务标题不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    任务地址 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="url" id="url" placeholder="任务地址"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['url']); ?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">任务地址必须填写。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <?php else: ?>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                   任务信息</label>
                                <div class="col-sm-9">
                                	<input type="text" name="title[]" placeholder="任务标题" class="col-xs-10 col-sm-5">
                                    <input type="text" name="url[]" placeholder="任务地址" class="col-xs-10 col-sm-5" style="margin-left:6px;">
									<span>
										<a href="javascript:;" onclick="addInfo(this)" class="green" style="margin-left:5px;" title="增加"><i class="ace-icon fa fa-plus-circle bigger-100"></i></a>
									</span>
                                </div>
                            </div>
                           
                            <div class="space-4"></div>
                            <div id="data_info"></div><?php endif; ?>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    任务要求 </label>
                                <div class="col-sm-9">
                                	 <?php if(is_array($money_type)): $i = 0; $__LIST__ = $money_type;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$money): $mod = ($i % 2 );++$i;?><input id="money_type" class="money_type" name="money_type[]" value="<?php echo ($money['id']); ?>" 
                                	 data-id="<?php echo ($money['id']); ?>" data-price="<?php echo ($money['price']); ?>" 
                                	 <?php if($money['checked'] == 1): ?>checked<?php endif; ?> type="checkbox"><label for="money_type"><?php echo ($money["title"]); ?>（￥<?php echo ($money["price"]); ?>）</label><?php endforeach; endif; else: echo "" ;endif; ?> 	
                                    
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                      <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    价格 </label>
                                <div class="col-sm-9">
                                    <input type="number" readonly name="price" id="price" placeholder="任务价格"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['price']); ?>">
                                    
                                </div>
                            </div>
                            <div class="space-4"></div>      
                            
					<div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    任务数量 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="num" id="num" placeholder="任务数量"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['num']); ?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">任务数量必须填写。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    总价 </label>
                                <div class="col-sm-9">
                                    <input type="number" readonly name="amount_price" id="amount_price" placeholder="总价"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['amount_price']); ?>">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="id-date-picker-1">截止日期</label>
                                <div class="col-xs-9 col-sm-9">
                                    <div class="input-group col-xs-5">
                                        <input class="form-control" id="end_t" name="end_t"
                                               value="<?php echo ($vo['end_t']); ?>" type="text"/>
                                        <span class="input-group-addon">
													<i class="ace-icon fa fa-calendar bigger-110"></i>
												</span>
												
                                    </div>
                                </div>
                            </div>
							<div class="space-4"></div>
							
							<div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    接单会员等级 </label>
                                <div class="col-sm-9">
                                	 <?php if(is_array($user_level)): $i = 0; $__LIST__ = $user_level;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$level): $mod = ($i % 2 );++$i;?><input id="user_level" class="user_level" name="user_level" value="<?php echo ($level['id']); ?>" 
                                	 data-id="<?php echo ($level['id']); ?>" 
                                	 <?php if($level['checked'] == 1): ?>checked<?php endif; ?> type="radio"><label for="user_level"><?php echo ($level["title"]); ?></label>&nbsp;&nbsp;<?php endforeach; endif; else: echo "" ;endif; ?> 	
                                    
                                </div>
                            </div>
                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4">任务图片</label>
                                <div class="col-sm-9">
                                	<div class="col-xs-10 col-sm-5"><?php echo BatchImage("pic",800,100,$vo['pic']);?></div>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    任务备注 </label>
                                <div class="col-sm-9">
                                <input type="text" name="remark" id="remark" placeholder="任务备注"
                                           class="col-xs-10 col-sm-5" value="<?php echo ($vo['remark']); ?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
								</div>			    
                            </div>
                            <div class="space-4"></div>
							<?php if($vo["id"] != ''): ?><div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">
                                    支付状态： </label>
                                <div class="col-sm-9" style="padding-top: 6px;">
                                    <select id="pay_status" name="pay_status" class="col-xs-10 col-sm-5"> 
                                      <option value="0" <?php if($vo["pay_status"] == 0): ?>selected<?php endif; ?>>待支付</option>
                                      <option value="1" <?php if($vo["pay_status"] == 1): ?>selected<?php endif; ?>>已支付</option>
                                    </select>
                                </div>
                            </div>
                            <div class="space-4"></div><?php endif; ?>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="button" onclick="history.back(-1);">
                                    <i class="icon-undo bigger-110"></i>
                                    取消
                                </button>
                            </div>

                            <!-- PAGE CONTENT ENDS -->


                        </form>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
        <div class="footer">
        <div class="footer-inner">
            <!-- #section:basics/footer -->
            <div class="footer-content">
                            <span class="bigger-120">
                                <small>Copyright &copy; 2020 <a href="<?php echo U('/home/index/index');?>" target="_blank"><?php echo (C("title")); ?></a> All Rights Reserved.</small>
                            </span>
            </div>

            <!-- /section:basics/footer -->
        </div>
    </div>

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>

</div><!-- /.main-container -->

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='/Public/qwadmin/js/jquery.js'>" + "<" + "/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='/Public/qwadmin/js/jquery1x.js'>" + "<" + "/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='/Public/qwadmin/js/jquery.mobile.custom.js'>" + "<" + "/script>");
</script>
<script src="/Public/qwadmin/js/bootstrap.js"></script>
<script src="/Public/qwadmin/js/bootbox.js"></script>
<!-- ace scripts -->
<script src="/Public/qwadmin/js/ace/elements.scroller.js"></script>
<script src="/Public/qwadmin/js/ace/elements.colorpicker.js"></script>
<script src="/Public/qwadmin/js/ace/elements.fileinput.js"></script>
<script src="/Public/qwadmin/js/ace/elements.typeahead.js"></script>
<script src="/Public/qwadmin/js/ace/elements.wysiwyg.js"></script>
<script src="/Public/qwadmin/js/ace/elements.spinner.js"></script>
<script src="/Public/qwadmin/js/ace/elements.treeview.js"></script>
<script src="/Public/qwadmin/js/ace/elements.wizard.js"></script>
<script src="/Public/qwadmin/js/ace/elements.aside.js"></script>
<script src="/Public/qwadmin/js/ace/ace.js"></script>
<script src="/Public/qwadmin/js/ace/ace.ajax-content.js"></script>
<script src="/Public/qwadmin/js/ace/ace.touch-drag.js"></script>
<script src="/Public/qwadmin/js/ace/ace.sidebar.js"></script>
<script src="/Public/qwadmin/js/ace/ace.sidebar-scroll-1.js"></script>
<script src="/Public/qwadmin/js/ace/ace.submenu-hover.js"></script>
<script src="/Public/qwadmin/js/ace/ace.widget-box.js"></script>
<script src="/Public/qwadmin/js/ace/ace.settings.js"></script>
<script src="/Public/qwadmin/js/ace/ace.settings-rtl.js"></script>
<script src="/Public/qwadmin/js/ace/ace.settings-skin.js"></script>
<script src="/Public/qwadmin/js/ace/ace.widget-on-reload.js"></script>
<script src="/Public/qwadmin/js/ace/ace.searchbox-autocomplete.js"></script>
<script src="/Public/qwadmin/js/jquery-ui.js"></script>
<script src="/Public/qwadmin/js/viewer.min.js"></script>
<script src="/Public/qwadmin/js/bootstrap-colorpicker.js"></script>
<script type="text/javascript" src="/Public/qwadmin/laydate/laydate.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
	//时间选择器
	laydate.render({
	  elem: '#end_t'
	  ,type: 'date'
	  ,min: 0
	});
	
	function addInfo(obj){
		var _html = '<d><div class="form-group">';
		_html += '<label class="col-sm-1 control-label no-padding-right" for="form-field-1"></label>';
		_html += '<div class="col-sm-9">';
		_html += '<input type="text" name="title[]" placeholder="任务标题" class="col-xs-10 col-sm-5">';
		_html += '<input type="text" name="url[]" placeholder="任务地址" class="col-xs-10 col-sm-5" style="margin-left:6px;">';
		_html += '<span><a href="javascript:;" onclick="addInfo(this)" class="green" style="margin-left:5px;" title="增加"><i class="ace-icon fa fa-plus-circle bigger-100"></i></a>';
		_html += '<a href="javascript:;" onclick="delInfo(this)" class="red" style="margin-left:5px;" title="删除"><i class="ace-icon fa fa-minus-circle bigger-100"></i></a></span>';
		_html += '</div></div><div class="space-4"></div></d>';
		$("#data_info").append(_html);
	}

	function delInfo(obj){
		$_this = $(obj);
		$_this.parent().parent().parent().parent().remove();
	}
	
	//校验任务标题和任务地址是否存在空项
	function checkTitleInfo()
	{
		var r = 0;
		$("input[name='title[]']").each(function(){
			if($(this).val() == ''){
				r++;
			}
		});
		return r;
	}
	
	function checkUrlInfo()
	{
		var r = 0;
		$("input[name='url[]']").each(function(){
			if($(this).val() == ''){
				r++;
			}
		});
		return r;
	}
	
	
	function checkUrlMatch(){
		var r = 0;
		$("input[name='url[]']").each(function(){
			if(!checkURL($(this).val())){
				r++;
			}
		});
		return r;
	}
	
	function checkURL(URL){
		var str=URL;
		//判断URL地址的正则表达式为:http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
		//下面的代码中应用了转义字符"\"输出一个字符"/"
		var Expression=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
		var objExp=new RegExp(Expression);
		if(objExp.test(str)==true){
			return true;
		}else{
			return false;
		}
	} 

	
	
    $(function () {
        $("#tabs").tabs();
        $(".submit").click(function () {
        	var tr = checkTitleInfo();
        	var ur = checkUrlInfo();
        	var cr = checkUrlMatch();
            var cid = $("#cid").val(); 
            var price = $("#price").val();
            var num = $("#num").val();
            var title = $("#title").val();
            var url = $("#url").val();
            var amount_price = $("#amount_price").val();
            var id = "<?php echo ($vo["id"]); ?>";
            
            
            if (cid == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "平台分类必须选择。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if(id == ''){
            	if(tr>0 || ur >0){
                	bootbox.dialog({
                        title: '友情提示：',
                        message: "任务标题或任务地址存在空项。",
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
                    return;
                }
            	
            	if(cr > 0){
            		bootbox.dialog({
                        title: '友情提示：',
                        message: "任务地址必须以http(s)开头。",
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
                    return;
            	}
            }else{
            	if (title == '') {
                    bootbox.dialog({
                        title: '友情提示：',
                        message: "任务标题不能为空。",
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
                    return;
                }
            	
            	if (url == '') {
                    bootbox.dialog({
                        title: '友情提示：',
                        message: "任务地址不能为空。",
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
                    return;
                }
            	
            	if(!checkURL(url)){
            		bootbox.dialog({
                        title: '友情提示：',
                        message: "任务地址必须以http(s)开头。",
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
                    return;
            	}
            }
            
            if (!$(".money_type").is(':checked') || price == '' || price == 0) {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "任务要求必须选择。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (num == '' || amount_price == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "任务数量必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            
            if (!$(".user_level").is(':checked')) {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "接单会员等级必须选择。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
        $(".money_type").click(function(){
        	var price = 0.0;
        	$(".money_type").each(function(){
        		if($(this).is(':checked')){
        			price += parseFloat($(this).attr('data-price'));
        		}
        	});
        	$("#price").val(price);
        	var n = parseInt($("#num").val());
        	$("#amount_price").val(n * price);
        });
        $("#num").keyup(function(){
        	var n = parseInt($(this).val());
        	var p = parseFloat($("#price").val());
        	$("#amount_price").val(n * p);
        });
    });
</script>
</body>
</html>